<template>
	<view class="reapRecord">
		<view class="orderItem" v-for="item in list" :key="item.id">
			<view class="order_info_top_box">
				<view class="order_sn">
					{{item.name}}
				</view>
				<view class="order_status">
					<span v-if="item.status=='payed'">种植中</span>
					<span v-if="item.status=='done'">已收获</span>
				</view>
			</view>
			<view class="order_info_center_box">
				<view class="center_item_box">
					<view class="center_item_title">
						种植面积
					</view>
					<view class="center_item_desc">
						{{item.num}}m²
					</view>
				</view>
				<view class="center_item_box">
					<view class="center_item_title">
						预计收获
					</view>
					<view class="center_item_desc">
						{{item.pre_yield}}kg/m²
					</view>
				</view>
				<view class="center_item_box">
					<view class="center_item_title">
						预计总收获
					</view>
					<view class="center_item_desc">
						{{item.pre_total_yield}}kg
					</view>
				</view>
			</view>
			<view class="order_bottom_btn_box" v-if="item.express_no&&item.express_no.length">
				<view class="parmary_btn"><button @tap="checkWuLiu(item)">查看物流信息</button></view>
			</view>
		</view>
		<u-popup :show="reapShow" mode="center" @close="closeReap" :round="12">
			<view class="reap_show_box">
				<view class="close_reap_btn" @tap="closeReap">
					<image src="../../static/images/icon/icon_gary_radios_fill.png" mode=""></image>
				</view>
				<view class="reap_title_box">
					物流信息
				</view>
				<view class="reap_box">
					<view class="line_box_title">
						快递公司
					</view>
					<view class="line_box_content">
						{{wuliu.express_com}}
					</view>
				</view>
				<view class="reap_box">
					<view class="line_box_title">
						快递单号
					</view>
					<view class="line_box_content">
						{{wuliu.express_no}}
					</view>
				</view>
			</view>
		</u-popup>
		<u-loadmore status="nomore" />
	</view>
</template>

<script>
	import com from '../../mixin/index.js';
	export default {
		mixins: [com],
		data() {
			return {
				page: {
					page: 1,
					page_size: 10
				},
				orderList: {
					lists: [],
					total: 1,
					total_page: 0
				},
				list: [],
				reapShow: false,
				wuliu: {}
			};
		},
		onLoad(val) {
			if (val.order_id) {
				this.$api.getAdoptOrderDetail({
					order_id: val.order_id
				}).then(res => {
					this.list = res.data.order_seed
				})
			}
		},

		methods: {
			checkWuLiu(val) {
				this.wuliu = val;
				this.reapShow = true;
			},
			closeReap() {
				this.reapShow = false;
			}
		}
	}
</script>

<style lang="scss">
	.reapRecord {
		padding: 20rpx 24rpx;
		min-height: 100vh;
		background-color: #F9F9F9;

		.orderItem {
			background: #ffffff;
			border-radius: 20rpx;
			padding: 32rpx 24rpx;
			margin-bottom: 20rpx;

			.order_info_top_box {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding-bottom: 28rpx;
				border-bottom: 1rpx dashed #cccccc;

				.order_sn {
					font-size: 28rpx;
					font-weight: 400;
					color: #000000;
				}

				.order_status {
					font-size: 30rpx;
					font-weight: 500;
					color: #222222;
				}
			}

			.order_info_center_box {
				display: flex;
				padding: 29rpx 20rpx;
				justify-content: space-between;
				// border-bottom: 1rpx dashed #cccccc;

				.center_item_box {
					text-align: center;

					.center_item_title {
						margin-bottom: 10rpx;
						font-weight: 400;
						font-size: 26rpx;
						color: #666666;
					}

					.center_item_desc {
						font-weight: 400;
						font-size: 30rpx;
						color: #222222;
					}
				}
			}

			.order_bottom_btn_box {
				display: flex;
				align-items: center;
				justify-content: flex-end;
				padding-top: 24rpx;
				border-top: 1rpx dashed #cccccc;

				view {
					margin-right: 20rpx;

					button {
						width: 150rpx;
						height: 58rpx;
						font-size: 24rpx;
						line-height: 58rpx;
						border-radius: 33rpx;
						padding: 0;
					}

					&:nth-last-child(1) {
						margin-right: 0rpx;
					}
				}
			}

			.parmary_btn {
				button {
					color: #222222;
					text-align: center;
					background: #ffffff;
					border-radius: 33rpx;
					border: 1rpx solid #cccccc;
				}
			}

		}

		.reap_show_box {
			width: 680rpx;
			box-sizing: border-box;
			padding: 30rpx 34rpx;
			position: relative;
			border-radius: 80rpx;

			.close_reap_btn {
				width: 45rpx;
				height: 45rpx;
				position: absolute;
				top: 30rpx;
				right: 30rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.reap_title_box {
				text-align: center;
				font-weight: 500;
				font-size: 36rpx;
				color: #222222;
				margin-bottom: 70rpx;
			}

			.reap_box {
				display: flex;
				align-items: center;
				margin-bottom: 20rpx;

				.line_box_title {
					font-size: 28rpx;
					color: #999999;
					margin-right: 33rpx;
				}

				.line_box_content {
					font-size: 28rpx;
					color: #333333;
				}
			}
		}
	}
</style>